﻿namespace PlaylistCopy.Extensions
{
    using System.Collections.Generic;
    using System.Linq;

    public static class EnumerableExtensions
    {
        public static IList<TSource> SafeEvaluate<TSource>(this IEnumerable<TSource> source)
        {
            if (source == null)
            {
                return null;
            }

            return source as IList<TSource> ?? source.ToList();
        }
    } 
}
